﻿using RabbitMQ.Client;

namespace SBlogCore.EventBus.CrossProcessEventBus.MQClient
{
    public class RabbitMqConnection
    {
        private readonly IConnection _conn;

        public RabbitMqConnection(ConnectionFactory factory)
        {
            _conn = factory.CreateConnection();//创建连接
        }
        public IConnection Conn()
        {
            return _conn;
        }
        public void Clear()
        {
            _conn.Dispose();
        }
    }
}
